import Cookies from 'js-cookie'
import config from '@/config/index.js'

// 全局函数 - 公共操作相关
const commonFunction = {

  /**
   * 设置 Cookies
   */
  setCookies(name, value, others = null) {
    Cookies.set(name, value, { domain: config.domain, ...others })
  },
  /**
   * 获取 Cookies
   */
  getCookies(name, others = null) {
    return Cookies.get(name, { domain: config.domain, ...others })
  },
  /**
   * 移除 Cookies
   */
  removeCookies(name, others = null) {
    Cookies.remove(name, { domain: config.domain, ...others })
  }
}
export default commonFunction
